﻿namespace MicroCloud.AspNetCore.Host.Options
{
    /// <summary>
    /// 宿主配置策略节点
    /// </summary>
    public class Host
    {
        #region 属性
        /// <summary>
        /// 获取或设置 宿主配置终结点字典
        /// </summary>
        public Dictionary<string, Endpoint> Endpoints { get; set; }

        #endregion

    }

    /// <summary>
    /// 终结点
    /// </summary>
    public class Endpoint
    {
        #region 属性
        /// <summary>
        /// 获取或设置 IP地址（*或者不填默认本机任意IP）
        /// </summary>
        public string Address { get; set; }
        
        /// <summary>
        /// 获取或设置 监听端口
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// 获取或设置 SSL证书（不为空时将使用HTTPS）
        /// </summary>
        public SSL SSL { get; set; }

        /// <summary>
        /// 获取或设置 是否启用
        /// </summary>
        public bool Enabled { get; set; }

        #endregion
    }

    /// <summary>
    /// SSL证书
    /// </summary>
    public class SSL
    {
        #region 属性
        /// <summary>
        /// 获取或设置 源
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// 获取或设置 证书路径
        /// </summary>
        public string Path { get; set; }

        /// <summary>
        /// 获取或设置 证书密钥
        /// </summary>
        public string Password { get; set; }

        #endregion

    }
}
